<template>
  <div class="allblo-da">
    <div class="allblogs">
      <div @click="particulars(item.id)" class="allblogs-item" v-for="(item,index) in articlesList " :key="index">
        <div class="item-headline">
          <h3 class="headline-h3">{{item.title}}</h3>
          <i class="headline-i">{{item.label_type}}</i>
        </div>
        <div class="item-explain">{{item.description}}</div>
        <div class="item-author">
          <span>{{item.nickname}}</span>
          <i>|</i>
          <span>发布时间：{{item.create_time}}</span>
        </div>
      </div>
    </div>
    <el-pagination @current-change="handleCurrentChange" :page-size="12" :total="count" background layout="total, prev, pager, next"></el-pagination>
  </div>
</template>

<script>
export default {
  name: 'Allblogs',
  props: {
    articlesList: Array,
    count: Number
  },
  methods: {
    handleCurrentChange(newPage) {
      this.$emit('pageChange', newPage)
    },
    particulars(id) {
      this.$router.push({ path: `/particular/${id}` })
    }
  }
}
</script>

<style >
.allblogs {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  background-color: #dce2da;
}
.allblogs-item {
  width: 611px;
  height: 155px;
  margin-top: 30px;
  margin-bottom: 30px;
  background-color: #f5f6f4;
  border-radius: 20px;
  box-shadow: 0px 0px 15px 5px rgba(100, 100, 100, 0.5);
  cursor: pointer;
}
.item-headline {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  box-sizing: border-box;
  padding: 0 30px;
}
.headline-h3 {
  font-size: 30px;
  font-weight: 700;
  transition: all 0.5s;
}
.headline-h3:hover {
  color: #f67280;
}
.headline-i {
  font-style: normal;
  font-size: 16px;
  font-weight: 700;
  color: #ffff;
  background-color: #f67280;
  padding: 0px 20px;
  border-radius: 20px;
  line-height: 33px;
  transition: all 0.5s;
}
.headline-i:hover {
  background-color: #506172;
  transition: all 0.5s;
}
.item-explain {
  font-size: 14px;
  margin-top: 15px;
  margin-bottom: 20px;
  margin-left: 50px;
}
.item-author {
  margin-left: 30px;
  font-size: 15px;
}
.item-author i {
  padding: 0 15px;
  color: #f67280;
}
.el-pagination {
  text-align: center;
  background-color: #dce2da;
  padding-bottom: 20px;
}
.allblo-da {
  width: 1300px;
  margin: 0 auto;
  background-color: #dce2da;
}
</style>